<template>
  <!-- 详情 弹出框 -->
  <el-dialog :title="dialogTitle" :visible.sync="visible" width="800px" append-to-body>
    <div v-loading="loading" style="margin-top: -20px">
      <el-table v-loading="loading" :data="auditList">
        <el-table-column label="工号/学号" align="center" prop="studentId" />
        <el-table-column label="姓名" align="center" prop="quesUserName" />
        <el-table-column label="电话" align="center" prop="quesUserNumber" />
        <el-table-column label="身份证" align="center" prop="quesTitle" />
        <el-table-column label="角色" align="center" prop="quesDescribe" />
      </el-table>
      <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
    </div>
  </el-dialog>
</template>

<script>
  import { listFeedback } from '@/api/problem/feedback';
  import { getStat } from '@/pages/views/account/statistics/service'
  import { getAccount } from '@/pages/views/account/manage/service'
  export default {
    name: 'AccountStatisticsDetails',
    props: ['currentRow'],
    data() {
      return {
        dialogTitle: '账号详情',
        // 遮罩层
        visible: false,
        // 遮罩层
        loading: true,
        // 总条数
        total: 0,
        // 表格数据
        auditList: [],
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
        },
      };
    },
    created() {
      this.getList();
    },
    methods: {
      // 显示弹框
      show() {
        // this.getList()
        this.visible = true
      },
      /** 查询列表 */
      getList() {
        this.loading = true;
        if (!this.currentRow.userId) {
          return;
        }
        getAccount(this.currentRow.userId)
          .then((response) => {
            debugger
            this.auditList = response.rows;
            this.total = response.total;
          })
          .finally(() => {
            this.loading = false;
          });
      },
      /** 查看详情操作 */
      handleOpenDetails(row) {
        this.currentRow = row;
        this.$nextTick(function () {
          this.$refs.reply.show();
        });
      },
    },
  };
</script>
